<div class="panel-default">
  <table lay-filter="demo" lay-size='lg'>
    <thead>
      <tr>

        <th lay-data="{field:'address'}"><%= Company.human_attribute_name(:address) %></th>

        <th lay-data="{field:'logo'}"><%= Company.human_attribute_name(:logo) %></th>

        <th lay-data="{field:'name'}"><%= Company.human_attribute_name(:name) %></th>

        <th lay-data="{field:'operation',width:200}"></th>
      </tr>
    </thead>

    <tbody>
      <% @companies.each do |company| %>
        <tr>

          <td><%= company.address %></td>

          <td class="enlarge"><%= image_tag company.logo_url, size: '35x35' rescue ''%></td>

          <td><%= company.name %></td>

          <td>
            <% unless company.used? %>
              <%= link_to set_used_admin_company_path(company), method: :post, class: "label label-primary" do -%>设置默认<% end %>
            <% end %>
            <%= link_to edit_admin_company_path(company), remote: true, class: "label" do -%><i class="iconfont icon-bianji"></i>编辑<% end %>
            <%= link_to [:admin, company], method: :delete, data: { confirm: '确定删除吗? 注意此操作无法撤销！' }, class: "label label-danger" do -%><i class="iconfont icon-shanchu"></i>删除<% end %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
  <%= link_to new_admin_company_path, remote: true do -%><button type="button" class="layui-btn"><i class="layui-icon">&#xe608;</i> <%= t('actions.new') + Company.model_name.human %></button><% end %>
  <!-- 分页 -->
  <%= render 'admin/public_views/page', record: @companies, record_count: @companies.count %>
</div>
<div id="add_company" style="display: none; padding: 20px"></div>
<!-- 放大图片 -->
<div class='elastic_show' hidden>
  <!-- 黑影 -->
  <div class="mask" hidden></div>
  <%= image_tag ''%>
</div>


